package psn.zjk.exporter;

import org.apache.poi.xssf.usermodel.XSSFCellStyle;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author sdyt_zhangjunkai
 * @version 1.0
 * @CLASS_NAME ExcelData
 * @DESCRIPTION
 * @CREATE_TIME 2020/9/10 9:51
 */
public class ExcelData {
    protected int firstRow;
    protected int firstColumn;
    protected int firstDataRowIndex;
    protected int firstDataColumnIndex;

    /**
     * 所有的行
     */
    protected Map<Integer, SheetRow> sheetRows = new HashMap<>(1024);
    /**
     * 所有的列
     */
    protected Map<Integer, SheetColumn> sheetColumns = new HashMap<>(32);


    /**
     * 行头
     */
    protected String rowHeaderField;

    /**
     * 列头/列头
     */
    protected String headerField;

    /**
     * 固定列头,一行对应一条数据
     */
    protected List<String> fixedHeaders;
    /**
     * 固定列头,一列对应一条数据
     */
    protected List<String> fixedRowHeaders;
    /**
     * 列头别名映射
     */
    protected Map<String, String> headerMapping;
    /**
     * 行头别名映射
     */
    protected Map<String, String> rowHeaderMapping;
    /**
     * 列头映射
     */
    protected Map<String, String> headerValueMapping;
    /**
     * 行头映射
     */
    protected Map<String, String> rowHeaderValueMapping;

    /**
     * 数据字段
     */
    protected String valueField;

    /**
     * 原始数据
     */
    protected List<?> datas;
    /**
     * 组装后的数据
     */
    protected Map<Long, SheetCell> assembledDatas = new HashMap<>(1024 >> 5);

    protected boolean autoSizeColumn;
    protected XSSFCellStyle defaultCellStyle;

    public String getRowHeaderField() {
        return rowHeaderField;
    }

    public void setRowHeaderField(String rowHeaderField) {
        this.rowHeaderField = rowHeaderField;
    }

    public String getHeaderField() {
        return headerField;
    }

    public void setHeaderField(String headerField) {
        this.headerField = headerField;
    }

    public List<String> getFixedHeaders() {
        return fixedHeaders;
    }

    public void setFixedHeaders(List<String> fixedHeaders) {
        this.fixedHeaders = fixedHeaders;
    }

    public List<String> getFixedRowHeaders() {
        return fixedRowHeaders;
    }

    public void setFixedRowHeaders(List<String> fixedRowHeaders) {
        this.fixedRowHeaders = fixedRowHeaders;
    }

    public Map<String, String> getHeaderMapping() {
        return headerMapping;
    }

    public void setHeaderMapping(Map<String, String> headerMapping) {
        this.headerMapping = headerMapping;
    }

    public Map<String, String> getRowHeaderMapping() {
        return rowHeaderMapping;
    }

    public void setRowHeaderMapping(Map<String, String> rowHeaderMapping) {
        this.rowHeaderMapping = rowHeaderMapping;
    }

    public String getValueField() {
        return valueField;
    }

    public void setValueField(String valueField) {
        this.valueField = valueField;
    }

    public List<?> getDatas() {
        return datas;
    }

    public void setDatas(List<?> datas) {
        this.datas = datas;
    }

    public Map<Long, SheetCell> getAssembledDatas() {
        return assembledDatas;
    }

    public boolean isAutoSizeColumn() {
        return autoSizeColumn;
    }

    public void setAutoSizeColumn(boolean autoSizeColumn) {
        this.autoSizeColumn = autoSizeColumn;
    }

    public Map<String, String> getHeaderValueMapping() {
        return headerValueMapping;
    }

    public void setHeaderValueMapping(Map<String, String> headerValueMapping) {
        this.headerValueMapping = headerValueMapping;
    }

    public Map<String, String> getRowHeaderValueMapping() {
        return rowHeaderValueMapping;
    }

    public void setRowHeaderValueMapping(Map<String, String> rowHeaderValueMapping) {
        this.rowHeaderValueMapping = rowHeaderValueMapping;
    }

    public XSSFCellStyle getDefaultCellStyle() {
        return defaultCellStyle;
    }

    public void setDefaultCellStyle(XSSFCellStyle defaultCellStyle) {
        this.defaultCellStyle = defaultCellStyle;
    }


    public int getFirstRow() {
        return firstRow;
    }

    public int getFirstColumn() {
        return firstColumn;
    }

    public Map<Integer, SheetRow> getSheetRows() {
        return sheetRows;
    }

    public Map<Integer, SheetColumn> getSheetColumns() {
        return sheetColumns;
    }

    public int getFirstDataRowIndex() {
        return firstDataRowIndex;
    }

    public int getFirstDataColumnIndex() {
        return firstDataColumnIndex;
    }
}
